module dequeueMuxer16 (
    input wire clk,
    input wire rst,
    input wire dequeue_vld_1,
    input wire dequeue_vld_2,
    input wire dequeue_vld_3,
    input wire dequeue_vld_4,
    input wire dequeue_vld_5,
    input wire dequeue_vld_6,
    input wire dequeue_vld_7,
    input wire dequeue_vld_8,
    input wire dequeue_vld_9,
    input wire dequeue_vld_10,
    input wire dequeue_vld_11,
    input wire dequeue_vld_12,
    input wire dequeue_vld_13,
    input wire dequeue_vld_14,
    input wire dequeue_vld_15,
    input wire dequeue_vld_16,
    input wire [7:0] is_last_head_1,
    input wire [7:0] is_last_head_2,
    input wire [7:0] is_last_head_3,
    input wire [7:0] is_last_head_4,
    input wire [7:0] is_last_head_5,
    input wire [7:0] is_last_head_6,
    input wire [7:0] is_last_head_7,
    input wire [7:0] is_last_head_8,
    input wire [7:0] is_last_head_9,
    input wire [7:0] is_last_head_10,
    input wire [7:0] is_last_head_11,
    input wire [7:0] is_last_head_12,
    input wire [7:0] is_last_head_13,
    input wire [7:0] is_last_head_14,
    input wire [7:0] is_last_head_15,
    input wire [7:0] is_last_head_16,
    input wire [5:0] dequeue_priority_1,
    input wire [5:0] dequeue_priority_2,
    input wire [5:0] dequeue_priority_3,
    input wire [5:0] dequeue_priority_4,
    input wire [5:0] dequeue_priority_5,
    input wire [5:0] dequeue_priority_6,
    input wire [5:0] dequeue_priority_7,
    input wire [5:0] dequeue_priority_8,
    input wire [5:0] dequeue_priority_9,
    input wire [5:0] dequeue_priority_10,
    input wire [5:0] dequeue_priority_11,
    input wire [5:0] dequeue_priority_12,
    input wire [5:0] dequeue_priority_13,
    input wire [5:0] dequeue_priority_14,
    input wire [5:0] dequeue_priority_15,
    input wire [5:0] dequeue_priority_16,
    input wire [9:0] dequeue_head_old_1,
    input wire [9:0] dequeue_head_old_2,
    input wire [9:0] dequeue_head_old_3,
    input wire [9:0] dequeue_head_old_4,
    input wire [9:0] dequeue_head_old_5,
    input wire [9:0] dequeue_head_old_6,
    input wire [9:0] dequeue_head_old_7,
    input wire [9:0] dequeue_head_old_8,
    input wire [9:0] dequeue_head_old_9,
    input wire [9:0] dequeue_head_old_10,
    input wire [9:0] dequeue_head_old_11,
    input wire [9:0] dequeue_head_old_12,
    input wire [9:0] dequeue_head_old_13,
    input wire [9:0] dequeue_head_old_14,
    input wire [9:0] dequeue_head_old_15,
    input wire [9:0] dequeue_head_old_16,
    output wire dequeue_vld,
    output wire [7:0] is_last_head,
    output wire [9:0] dequeue_head_old
);
    wire [3:0] dequeue_vld_group;
    wire [5:0] dequeue_priority_group [0:3];
    wire [7:0] is_last_head_group [0:3];
    wire [9:0] dequeue_head_old_group [0:3];

    
    //第一层仲裁器
    dequeueMuxer4 muxer1(.dequeue_vld_1(dequeue_vld_1), .dequeue_priority_1(dequeue_priority_1), .is_last_head_in_1(is_last_head_1), .dequeue_head_old_in_1(dequeue_head_old_1), 
                        .dequeue_vld_2(dequeue_vld_2), .dequeue_priority_2(dequeue_priority_2), .is_last_head_in_2(is_last_head_2), .dequeue_head_old_in_2(dequeue_head_old_2), 
                        .dequeue_vld_3(dequeue_vld_3), .dequeue_priority_3(dequeue_priority_3), .is_last_head_in_3(is_last_head_3), .dequeue_head_old_in_3(dequeue_head_old_3), 
                        .dequeue_vld_4(dequeue_vld_4), .dequeue_priority_4(dequeue_priority_4), .is_last_head_in_4(is_last_head_4), .dequeue_head_old_in_4(dequeue_head_old_4), 
                        .dequeue_vld_out(dequeue_vld_group[0]), .dequeue_priority_out(dequeue_priority_group[0]), .is_last_head_out(is_last_head_group[0]), .dequeue_head_old_out(dequeue_head_old_group[0]));
    
    dequeueMuxer4 muxer2(.dequeue_vld_1(dequeue_vld_5), .dequeue_priority_1(dequeue_priority_5), .is_last_head_in_1(is_last_head_5), .dequeue_head_old_in_1(dequeue_head_old_5), 
                        .dequeue_vld_2(dequeue_vld_6), .dequeue_priority_2(dequeue_priority_6), .is_last_head_in_2(is_last_head_6), .dequeue_head_old_in_2(dequeue_head_old_6), 
                        .dequeue_vld_3(dequeue_vld_7), .dequeue_priority_3(dequeue_priority_7), .is_last_head_in_3(is_last_head_7), .dequeue_head_old_in_3(dequeue_head_old_7), 
                        .dequeue_vld_4(dequeue_vld_8), .dequeue_priority_4(dequeue_priority_8), .is_last_head_in_4(is_last_head_8), .dequeue_head_old_in_4(dequeue_head_old_8), 
                        .dequeue_vld_out(dequeue_vld_group[1]), .dequeue_priority_out(dequeue_priority_group[1]), .is_last_head_out(is_last_head_group[1]), .dequeue_head_old_out(dequeue_head_old_group[1]));

    dequeueMuxer4 muxer3(.dequeue_vld_1(dequeue_vld_9), .dequeue_priority_1(dequeue_priority_9), .is_last_head_in_1(is_last_head_9), .dequeue_head_old_in_1(dequeue_head_old_9), 
                        .dequeue_vld_2(dequeue_vld_10), .dequeue_priority_2(dequeue_priority_10), .is_last_head_in_2(is_last_head_10), .dequeue_head_old_in_2(dequeue_head_old_10), 
                        .dequeue_vld_3(dequeue_vld_11), .dequeue_priority_3(dequeue_priority_11), .is_last_head_in_3(is_last_head_11), .dequeue_head_old_in_3(dequeue_head_old_11), 
                        .dequeue_vld_4(dequeue_vld_12), .dequeue_priority_4(dequeue_priority_12), .is_last_head_in_4(is_last_head_12), .dequeue_head_old_in_4(dequeue_head_old_12), 
                        .dequeue_vld_out(dequeue_vld_group[2]), .dequeue_priority_out(dequeue_priority_group[2]), .is_last_head_out(is_last_head_group[2]), .dequeue_head_old_out(dequeue_head_old_group[2]));

    dequeueMuxer4 muxer4(.dequeue_vld_1(dequeue_vld_13), .dequeue_priority_1(dequeue_priority_13), .is_last_head_in_1(is_last_head_13), .dequeue_head_old_in_1(dequeue_head_old_13), 
                        .dequeue_vld_2(dequeue_vld_14), .dequeue_priority_2(dequeue_priority_14), .is_last_head_in_2(is_last_head_14), .dequeue_head_old_in_2(dequeue_head_old_14), 
                        .dequeue_vld_3(dequeue_vld_15), .dequeue_priority_3(dequeue_priority_15), .is_last_head_in_3(is_last_head_15), .dequeue_head_old_in_3(dequeue_head_old_15), 
                        .dequeue_vld_4(dequeue_vld_16), .dequeue_priority_4(dequeue_priority_16), .is_last_head_in_4(is_last_head_16), .dequeue_head_old_in_4(dequeue_head_old_16), 
                        .dequeue_vld_out(dequeue_vld_group[3]), .dequeue_priority_out(dequeue_priority_group[3]), .is_last_head_out(is_last_head_group[3]), .dequeue_head_old_out(dequeue_head_old_group[3]));
    //第二组仲裁器
    dequeueMuxer4 muxer(.dequeue_vld_1(dequeue_vld_group[0]), .dequeue_priority_1(dequeue_priority_group[0]), .is_last_head_in_1(is_last_head_group[0]), .dequeue_head_old_in_1(dequeue_head_old_group[0]), 
                        .dequeue_vld_2(dequeue_vld_group[1]), .dequeue_priority_2(dequeue_priority_group[1]), .is_last_head_in_2(is_last_head_group[1]), .dequeue_head_old_in_2(dequeue_head_old_group[1]), 
                        .dequeue_vld_3(dequeue_vld_group[2]), .dequeue_priority_3(dequeue_priority_group[2]), .is_last_head_in_3(is_last_head_group[2]), .dequeue_head_old_in_3(dequeue_head_old_group[2]), 
                        .dequeue_vld_4(dequeue_vld_group[3]), .dequeue_priority_4(dequeue_priority_group[3]), .is_last_head_in_4(is_last_head_group[3]), .dequeue_head_old_in_4(dequeue_head_old_group[3]), 
                        .dequeue_vld_out(dequeue_vld), .dequeue_priority_out(), .is_last_head_out(is_last_head), .dequeue_head_old_out(dequeue_head_old));
endmodule